<template>
	<el-table :data="tableData" border highlight-current-row>
		<el-table-column type="selection" width="80" align="center"></el-table-column>
        <el-table-column type="index" label="序号" width="70" align="center"></el-table-column>
        <el-table-column property="name" label="名称" min-width="150" align="center"></el-table-column>
        <el-table-column property="locks" label="是否可用" min-width="80" align="center">
            <template slot-scope="scope">
                <span>{{ scope.row.locks == 1 ? '是' : '否' }}</span>
            </template>
        </el-table-column>
	</el-table>
</template>
<script>
export default {
	data() {
		return {
			tableData: [],
			provinceId: this.$store.state.cityDictionaryStore.provinceId
		}
	},
	watch: {
		provinceId(newVal) {
			this.getCityByProvinceId(newVal[0]);
		}
	},
	methods: {
		getCityByProvinceId(pid) {			//通过省份id获取城市数据
			this.$http.get('city/findCity?parentId=' + pid).then(res => {
				if(res.data.code == 20001) {
					if(res.data.data) {
						this.tableData = res.data.data;
					}
				}
			});
		}
	}
}
</script>